<nz-table
    #nestedTable
    [nzLoading]='tableLoading'
    [nzScroll]='scrollValue'
    [nzData]='tableData'
    [(nzPageSize)]='searchObj.pageSize'
    [nzTotal]='total'
    [(nzPageIndex)]='searchObj.pageNum'
    [nzShowPagination]='true'
    [nzFrontPagination]='false'
    (nzPageSizeChange)='list()'
    (nzPageIndexChange)='list()'
    nzShowSizeChanger
    nzShowQuickJumper='true'
>
    <thead>
    <tr>
        <th [nzWidth]='"50px"' nzLeft></th>
        <th *ngFor="let column of tableColumnArray">{{ column.name }}</th>
        <th nzWidth='170px' nzRight>
            操作
        </th>
    </tr>
    </thead>
    <tbody [@listAnimation]='tableData'>
        <ng-template ngFor let-item [ngForOf]='tableData'>
            <tr>
                <td [(nzExpand)]='item.expand' nzLeft ></td>
                <td *ngFor="let column of tableColumnArray">
                    <span *ngIf='column.type === 1'>{{ item[column.key] }}</span>
                    <span *ngIf='column.type === 2'>
                    <nz-tag *ngIf='tableCaseMap.get(column.key).get(item[column.key]+"")' [nzColor]='tableCaseMap.get(column.key).get(item[column.key]+"").color'>{{ tableCaseMap.get(column.key).get(item[column.key]+"").tag }}</nz-tag>
                    <nz-tag *ngIf='!tableCaseMap.get(column.key).get(item[column.key]+"")' [nzColor]='tableCaseMap.get(column.key).get("other").color'>{{ tableCaseMap.get(column.key).get("other").tag }}</nz-tag>
                </span>
                </td>
                <td *ngIf='optionModelList != null' nzRight>
                    <ng-container *ngFor="let optionModel  of optionModelList; let i = index"  >
                        <ng-container *ngIf='optionModel.optionLabelType == OptionTypeEnum.TEXT' [ngSwitch]='optionModel.eventKey'>
                            <nz-divider *ngIf='i!=0' nzType="vertical" ></nz-divider>
                            <a *ngSwitchCase='OptionKeyEnum.DELETE'
                               nz-popconfirm
                               nzPopconfirmTitle="确认删除?"
                               (nzOnConfirm)="onDelete(item)"
                            >
                                {{optionModel.optionLabel}}
                            </a>
                            <a  *ngSwitchDefault (click)='eventPublish(item,optionModel.eventKey)'>
                                {{optionModel.optionLabel}}
                            </a>
                        </ng-container>
                        <div *ngIf='optionModel.optionLabelType == OptionTypeEnum.SELECT'>
                            <label  nz-checkbox [(ngModel)]="item.isCheckedButton" (ngModelChange)="checkedButtonChange(item)">
                            </label>
                        </div>
                    </ng-container>
                </td>
            </tr>
            <tr [nzExpand]='item.expand'>
                    <app-sub-table #subTableComponent [refresh]='item["refresh"]' [expand]='item.expand' [optionModelList]='subOptionModelList' [otherOptionModelList]='subOtherOptionModelList' (optionEvent)='subEventPublish($event)'  [tableKey]='subTableKey' [mainItem]='item' [cateId]='item[cateId]' [tableColumnMap]='subTableColumnArray' [dataService]='subDataService' [tableCaseMap]='tableCaseMap'></app-sub-table>
            </tr>
        </ng-template>
    </tbody>
</nz-table>
